
package me.zhengjie.modules.transformer.history.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
 * @website https://el-admin.vip
 * @description /
 * @author 陈佳豪
 * @date 2021-12-02
 **/
@Entity
@Data
@Table(name="fds_data")
public class FdsData  extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "ID")
    private Integer id;

    @Column(name = "equip_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "变压器ID")
    private Integer equipId;

    @Column(name = "record_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "导入批次")
    private Integer recordId;

    @Column(name = "frequency",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "频率")
    private String frequency;

    @Column(name = "tan_delta",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "介质损耗因数")
    private String tanDelta;

    @Column(name = "power_factor",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "功率因数")
    private String powerFactor;

    @Column(name = "e_real",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "复介电常数实部")
    private String eReal;

    @Column(name = "e_imaginary",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "复介电常数虚部")
    private String eImaginary;

    @Column(name = "c_real",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "复电容实部")
    private String cReal;

    @Column(name = "c_imaginary",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "复电容虚部")
    private String cImaginary;



    public void copy(FdsData source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}